package com.eastfair.imaster.hystrix;

import com.eastfair.core.base.R;
import com.eastfair.imaster.api.ExhibitorServiceFeign;
import com.eastfair.imaster.dto.ExhibitorDTO;
import com.eastfair.imaster.entity.ExhibitorProduct;
import com.eastfair.imaster.vo.ExhibitorVo;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * 用户API熔断
 *
 * @author zuihou
 * @date 2019/07/23
 */
@Component
public class ExhibitorApiFallback implements ExhibitorServiceFeign {

//    @Autowired
//    WorkAspect workAspect;
    @Override
    public R addCompanyOfExhibitor(ExhibitorDTO exhibitorDTO) {
//        /**
//         * 手动进行事务回滚
//         */
//        try {
//            this.workAspect.doRecoveryActions(throwable);
//        } catch (TransactionException e) {
//            e.printStackTrace();
//        }
        return R.timeout();
    }

    @Override
    public R<Boolean> upsertExhibitorProduct(List<ExhibitorProduct> exhibitorProducts) {
        return R.timeout();
    }

    @Override
    public R<List<ExhibitorVo>> queryByIds(ExhibitorDTO exhibitorDTO) {
        return R.timeout();
    }
}
